import { Component, EventEmitter, Input, Output } from '@angular/core';
import { SrmOrientation } from 'src/components/scenarios/enums';
import { FieldMapConfig, LaneConfig } from 'src/components/scenarios/models';

@Component({
  selector: 'app-lane-setting',
  templateUrl: './lane-setting.component.html',
  styleUrl: './lane-setting.component.scss'
})
export class LaneSettingComponent {
  orientations: SrmOrientation[] = Object.values(SrmOrientation);

  private _lane!: LaneConfig;

  get fieldNames(): string[] {
    return this.fields.map(f => f.Name);
  }

  @Input()

  public get lane(): LaneConfig {
    return this._lane;
  }
  public set lane(value: LaneConfig) {
    this._lane = value;
  }

  @Output()
  laneChange: EventEmitter<LaneConfig> = new EventEmitter();

  @Input()
  fields: FieldMapConfig[] = [];
}
